﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;

namespace Test
{
  class Program
  {
    static void Main(string[] args)
    {
      DBOX.cService service = new DBOX.cService();
      service.voltage.yNumberOfCells = 5;

      String te = service.uTemperature.uUnits;

      for (int i = 0; i < 10; i++)
      {
          service.buffer = naplnBuffer();
          service.decode();
      }
    
    }
  
      
    static byte[] naplnBuffer()
    {
        string retezec = "7E7EFD0315";
        retezec += "801F7FA900007E7EFE445A50A4000000007E7EFE445A50A4000000007E7EFD0416";
        retezec += "A031";
        retezec += "A12C00007E7EFE445A50A4000000007E7EFE435A50A3000000007E7EFE445A50A4000000007E7EFD0517";
        retezec += "A20767";
        retezec += "A30D007E7EFE435A50A3000000007E7EFE445A51A4000000007E7EFE435A50A3000000007E7EFD0518";
        retezec += "A416";
        retezec += "A50678007E7EFE435A50A4000000007E7EFE445A50A4000000007E7EFE445A50A4000000007E7EFD0619";
        retezec += "A61D4D";
        retezec += "A703017E7EFE435A50A4000000007E7EFD051A";
        retezec += "A80240";
        retezec += "A90A007E7EFE445A50A5000000007E7EFE435A50A5000000007E7EFE435A50A5000000007E7EFD061B";
        retezec += "AA408A";
        retezec += "AB78B07E7EFE435A50A6000000007E7EFE445A50A4000000007E7EFE445A50A5000000007E7EFD061C";
        retezec += "AC024D";
        retezec += "AD024E7E7EFE445A50A4000000007E7EFE435A50A5000000007E7EFE445A50A4000000007E7EFD051D";
        retezec += "AE024F";
        retezec += "AF03007E7EFE445A50A4000000007E7EFE445A50A3000000007E7EFE435A4FA3000000007E7EFE435A50A4000000007E7EFE435A50A3000000007E7EFD031E";
        retezec += "81077F0000007E7EFE445A50A4000000007E7EFE445A50A3000000007E7EFE445A50A3000000007E7EFD031F";
        retezec += "82074FA300007E7EFE435A50A4000000007E7EFE435A50A3000000007E7EFE435A50A4000000007E7EFD0300";
        retezec += "8306550000007E7EFE435A50A3000000007E7EFE435A50A4000000007E7EFE435A50A3000000007E7EFD0301";
        retezec += "84063DA700007E7EFE435A50A3000000007E7EFE445A50A4000000007E7EFD0302";
        retezec += "850624A900007E7EFE435A50A3000000007E7EFE435A51A4000000007E7EFE435A50A3000000007E7EFD0303";
        retezec += "86060C0";
        retezec += "8AB00007E7EFE435A50A4000000007E7EFE435A50A3000000007E7EFE435A50A3000000007E7EFD03048A016FAD00007E7EFE445A50A4000000007E7EFE445A50A2000000007E7EFE445A50A4000000007E7EFD0305";
        retezec += "8B0000AF00007E7EFE435A50A3000000007E7EFE435A50A4000000007E7EFD0206";
        retezec += "8C00500000007E7EFE445A50A3000000007E7EFD0107000356A300007E7EFE445A50A3000000007E7EFE445A51A4000000007E7EFD0308";
        retezec += "8D00000000007E7EFE445A50A2000000007E7EFE435A51A4000000007E7EFE435A51A3000000007E7EFD0609";
        retezec += "9406174D";
        retezec += "95007E7EFD0209016B000095007E7EFE435A50A4000000007E7EFE435A50A3000000007E7EFD030A";
        retezec += "967818A900007E7EFE445A51A3000000007E7EFE435A51A3000000007E7EFE445A51A3000000007E7EFD030B00";

      byte[] buf = new byte[retezec.Length/2];

      int index = 0;
      for (int i=0; i<retezec.Length; i+=2)
      {
        buf[index++] = (byte)(Convert.ToInt32(retezec.Substring(i,2),16));
      }

      return buf;
    }
  }

}
